/*
 * $Id: locale.h,v 1.19 2005-11-24 10:58:19 bacon Exp $
 */

#ifndef _XP_BAS_LOCALE_H_
#define _XP_BAS_LOCALE_H_

#include <xp/types.h>
#include <xp/macros.h>

#ifdef __cplusplus
extern "C" {
#endif

int xp_setlocale (void);

extern xp_size_t (*xp_wcmclen) (xp_wchar_t wc);
extern xp_size_t (*xp_wctomc) (
	xp_wchar_t wc, xp_mchar_t* mc, xp_size_t mcsz);
extern xp_size_t (*xp_mctowc) (
	const xp_mchar_t* mc, xp_size_t mcsz, xp_wchar_t* wc);
extern xp_size_t (*xp_mcseqlen) (xp_mchar_t fc);

xp_size_t xp_wcsmclen (const xp_wchar_t* wcs);
xp_size_t xp_wcsnmclen (const xp_wchar_t* wcs, xp_size_t wcslen);
xp_size_t xp_mcswclen (const xp_mchar_t* mcs);
xp_size_t xp_mcsnwclen (const xp_mchar_t* mcs, xp_size_t mcslen);

xp_size_t xp_wcstomcs (
	const xp_wchar_t* wcs, xp_mchar_t* mcs, xp_size_t mcssz);
xp_size_t xp_wcsntomcs (
	const xp_wchar_t* wcs, xp_size_t wcslen, xp_mchar_t* mcs, xp_size_t* mcssz);

xp_size_t xp_mcstowcs (
	const xp_mchar_t* mcs, xp_wchar_t* wcs, xp_size_t wcssz);
xp_size_t xp_mcsntowcs (
	const xp_mchar_t* mcs, xp_size_t mcslen, xp_wchar_t* wcs, xp_size_t* wcssz);

int xp_wcstomcs_strict (
	const xp_wchar_t* wcs, xp_mchar_t* mcs, xp_size_t mcssz);
int xp_mcstowcs_strict (
	const xp_mchar_t* mcs, xp_wchar_t* wcs, xp_size_t wcssz);

xp_mchar_t* xp_wcstomcs_dynamic (const xp_wchar_t* wcs);
xp_wchar_t* xp_mcstowcs_dynamic (const xp_mchar_t* mcs);

#ifdef __cplusplus
}
#endif

#endif
